package main;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class Test {

	
	public static Map<Integer, Integer> getExpected(File filename){
		Map<Integer, Integer> expected = new HashMap<Integer, Integer>();
		
		try{
			BufferedReader br = new BufferedReader(new FileReader(filename));
			String line = br.readLine(); // read first line
			while ((line = br.readLine())!=null){
				String[] tokens = line.split(" ");
				expected.put(Integer.parseInt(tokens[0].trim()), Integer.parseInt(tokens[1].trim()));
			}
			
		}
		catch(IOException ioex){
			ioex.printStackTrace();
		}
		
		return expected;
	}
	
	public static void main(String[] args) {
		
		int maxVertices = 20;
		if (args.length > 0){
			maxVertices = Integer.parseInt(args[0]);
		}
		
		Map<Integer, Integer> expected = getExpected(new File("Lefel_Zilberman/test.txt"));
		
		for (int i=3; i<=maxVertices; i++){
			int actual = Main.run(new String[]{Integer.toString(i), "false"});
			System.out.print(Integer.toString(i) + ": " + expected.get(i) + "--" + actual);
			if (expected.get(i).intValue()!=actual){
				System.out.println("  --> ERROR!!");
			}
			System.out.println();
		}
	}
}
